<%-- 
    Document   : showMovie
    Created on : Jun 4, 2014, 10:05:27 AM
    Author     : Phan Van Duong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>DVD Shop Online - Media</title>
    </head>
    <body>
        <h1>Show Media</h1>
        <form action="MediaController?task=searchMedia" method="post">
            <input name="txtMedia"/><input type="submit" value="Search"/>
            <a href="">Advance</a>
        </form>
        <c:set var="medias" value="${requestScope.MEDIAS}"/>
        <c:if test="${not empty medias}">
            <c:forEach var="media" items="${medias}">
                <div style="float:left;border:1px blue solid;margin: 10px;height:300px;width: 200px" >
                    <table>
                        <td colspan="2" align="center">
                            <c:url var="title" value="MediaController?task=showMediaDetail">
                                <c:param name="mediaId" value="${media.mediaId}"/>
                            </c:url>
                            <a href="${title}">${media.title}</a>
                        </td>
                        <tr>
                            <td colspan="2" align="center"><img alt="No Image"  src="images/${media.representImg}" height="150px" width="100px"></td>
                        </tr>
                        <tr>
                            <td>Producer</td>
                            <td>${media.producers.name}</td>
                        </tr>
                        <tr>
                            <td>Artist</td>
                            <td>${media.artist.name}</td>
                        </tr>
                        <tr>
                            <td>Price</td>
                            <td>${media.price} $</td>
                        </tr>
                    </table>
                </div>
            </c:forEach>
        </c:if>

    </body>
</html>
